package nl.hu.vakantievibes.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class VakantieVibes implements EntryPoint {
		
	public void onModuleLoad() {
		new DummyData();
		new HistoryListener();
		Systeem.get().createLinks();
		Systeem.get().createNavigation();
		    
		// set uncaught exception handler
		GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {
		
			public void onUncaughtException(Throwable throwable) {
				String text = "Uncaught exception: ";
				while (throwable != null) {
					StackTraceElement[] stackTraceElements = throwable.getStackTrace();
					text += throwable.toString() + "\n";
					for (StackTraceElement element : stackTraceElements) {
						text += " at " + element + "\n";
					}
					throwable = throwable.getCause();
				    if (throwable != null) {
				    	text += "Caused by: ";
				    }
				}
				GWT.log(text);
			}
		});
	}
}
